package com.zhanghp.demo02.state;

import com.zhanghp.demo02.IPlayer;
import com.zhanghp.demo02.IState;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zhanghp
 * @date 2022-09-05 13:56
 */
@Slf4j
public class IReadyState extends IState {
    public IReadyState(IPlayer iPlayer) {
        super(iPlayer);
        iPlayer.setPlaying(true);
    }

    @Override
    protected void onPlay() {
        super.iPlayer.play();
        super.iPlayer.changeState(new IPlayingState(iPlayer));
    }

    @Override
    protected void onLocked() {
        super.iPlayer.changeState(new ILockState(iPlayer));
    }

    @Override
    protected void next() {
        log.info("Locked ... ");
    }

    @Override
    protected void previous() {
        log.info("Locked ... ");
    }
}
